from django.shortcuts import render
from datetime import datetime


def jinja2(request):

    # 准备数据
    context = {
        "my_list": [1, 2, 3, 4, 5]
    }

    return render(request, "jinja2.html", context=context)


# 渲染子模板
def child(request):
    return render(request, "child.html")


# 渲染父模板
def base(request):
    return render(request, "base.html")


# Create your views here.
def index(request):

    # 准备数据
    context = {
        "html_str": "<h1>我是标题</h1>",
        "my_str": "itcast",
        "my_date": datetime.now(),
        "my_list": [1, 2, 3, 4, 5]
    }

    return render(request, "filter.html", context=context)